home *** CD-ROM | disk | FTP | other *** search
- <!--//--><script language="javascript">
- /*
- File Dependencies:
- objRO.js The Request Object (ro) - This is included here to provide support for the objTI.js
- objTI.js The TKM Installer (ti)
- objPC.js The PluginChecker(2).dll Script Wrapper (pc)
- objWTUI.js The wotktoolui.dll Script Wrapper (wtui)
- objII.js The Image Info Object (ii)
-
- Required Initialization Method:
- LUI_Init Shows the appropriate UI based on the installation status
- */
-
-
- // #### BEGIN g_sTKMRoot DEFINITION ####
- // Start at the beginning of the location and find our document root directory
- var g_sHref = location.href.toLowerCase();
- var g_nEndPos = g_sHref.indexOf('outfitter/');
- // Grab everything up to the end of the word outfitter and add "/tkm/" to set the TKM Root
- var g_sTKMRoot = g_sHref.substring(0, (g_nEndPos + 9)) + '/tkm/';
- // Move past the "outfitter/" string and start looking for the geo/lang
- var g_nBeginGeo = g_nEndPos + 10;
- // Find the next "/" and we have the geo/lang
- var g_nEndGeo = g_sHref.indexOf('/', g_nBeginGeo);
- // Parse out the geo/lang so we know what to use
- var g_sGeo = g_sHref.substring(g_nBeginGeo, g_nEndGeo);
- // #### END g_sTKMRoot DEFINITION ####
-
- // #### BEGIN OS SNIFFER ###
- var agt=navigator.userAgent.toLowerCase();
-
- if(((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1))) g_sOS = "win98";
- else if(((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1))) g_sOS = "win2000";
- // #### END OS SNIFFER ###
-
-
- // #### BEGIN ADD DEPENDENCIES ####
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objRO.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objTI.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objPC.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objWTUI.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objII.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objXP.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/objTU.js">');
- document.write('\n<' + '/script>\n');
- document.write('<script language="javascript1.2" src="' + g_sTKMRoot + 'scripts/cookie.js">');
- document.write('\n<' + '/script>\n');
- // #### END ADD DEPENDENCIES ####
-
- function LUI()
- {
- // Constructor(s)
- this.TOOLSET = LUI_TOOLSET;
-
- // Method(s)
- this.CallTKMInstall = LUI_CallTKMInstall;
- this.Init = LUI_Init;
- this.Poll = LUI_Poll;
- this.Exit = LUI_Exit;
- this.Run = LUI_Run;
- this.CreateChild = LUI_CreateChild;
- this.DestroyChild = LUI_DestroyChild;
-
- // Constant(s)
- this.MEDIUM_CD = 1;
- this.MEDIUM_WEB = 2;
- this.SCENARIO_EYPC = 1;
- this.SCENARIO_CD = 2;
- this.SCENARIO_SS = 3;
- this.SCENARIO_PT = 4;
- this.SCENARIO_PBB = 5;
- this.GEOiXML = 1;
- this.MAINiXML = 2;
- this.PRODiXML = 3;
-
- // Field(s)
- this.exitfunc = ''; // The function to call when we are finished
- this.arglist = ''; // The list of arguments to pass to the exitfunc, if any
- this.toollist = ''; // The list of tools to call the lui.Run function with
- this.scenario = 5; // The scenario to pass to the WOTKToolUI.dll
- this.medium = this.MEDIUM_WEB; // The locaiton to install from
- this.childwindow = null; // A pointer to any childwindow that we call
- }
-
-
- /* TOOLSET constructor */
- function LUI_TOOLSET()
- {
- // Constructor(s)
- this.TOOL = LUI_TOOLSET_TOOL;
-
- // Method(s)
- this.AddTool = LUI_TOOLSET_AddTool;
- this.Install = LUI_TOOLSET_Install;
-
- // Field(s)
- this.tools = new Array(0); // The array that holds any tools to check for, built by the AddTool method
- }
-
-
- /* TOOL constructor */
- function LUI_TOOLSET_TOOL(key, version)
- {
- this.key = key;
- this.version = version;
-
- return this;
- }
-
-
- function LUI_CallTKMInstall()
- {
- /* The TKM is not installed or needs an update, so tell the TKM object to install the software */
- /* Before we can install the TKM we need to save the state of this object so we can immediately
- launch the tool install when the TKM is finished */
- top.LUI_toollist = this.toollist;
- top.LUI_exitfunc = this.exitfunc;
- top.LUI_arglist = this.arglist;
- top.LUI_launch = true;
-
- ti.Install();
- }
-
-
- function LUI_Run()
- {
- var isInstallRunning = false;
- /* Here we make the magic happen, call the control, get status, all that good stuff */
- if (ti.status == ti.INSTALLED)
- {
- var sCurrentMedium = this.MEDIUM_WEB;
-
- // Check to see if the install is running from the CD
- if (wtui.GetInstallMedium() == 1) sCurrentMedium = this.MEDIUM_CD;
-
- if (this.medium != sCurrentMedium)
- {
- // 73s_already_progress.gif
- this.CreateChild(g_sTKMRoot + "html/already_in_progress.htm?geo=" + g_sGeo, "UserPrompt", ii.progress);
- }
- else
- {
- // Check the XML for the OS specific tools
-
- //var l_toollist = GetNewString(this.toollist);
- //this.toollist = l_toollist;
- var nRetVal = 0;
-
- nRetVal = wtui.Run(this.toollist, this.medium, this.scenario);
-
- switch (nRetVal)
- {
- case 0: // Nothing has happened, what should we do?
- break;
- case 1: // The controls are up-to-date, no install is neccesary
- this.Exit();
- break;
- case 2: // To late to add, what should we do?
- /* Installation already in progress... (73s_already_progress.gif)
- Let the user know that the installation is to far along to add these tools. */
- this.CreateChild(g_sTKMRoot + "html/already_in_progress.htm?geo=" + g_sGeo, "UserPrompt", ii.progress);
- break;
- case 3: // The tools were added to the list
- setTimeout('lui.Poll()', 10000);
- break;
- case 4: // The installer was launched, there was nothing running
- setTimeout('lui.Poll()', 10000);
- break;
- case 5: // Cancel was pressed, go to site without installing
- this.Exit();
- break;
- case 6: // An error occurred so just go to the site
- this.Exit();
- break;
- case 7: // The items were already in the list of things to install
- setTimeout('lui.Poll()', 10000);
- break;
- }
- }
- }
- else if (ti.status == ti.PATCH_REQ)
- {
- if(document.layers)
- {
- if (pc.IsWOTKInstallerRunning()) isInstallRunning = true;
- }
- if(document.all)
- {
- if(tu.IsTKMFileInUse('WOTKINSTALLUI2.exe') == 'YES') isInstallRunning = true;
- }
- //if (pc.IsWOTKInstallerRunning())
- if(isInstallRunning)
- {
- /* 74s_please_wait.gif */
- this.CreateChild(g_sTKMRoot + "html/please_wait.htm?geo=" + g_sGeo,"UserPrompt", ii.wait);
- }
- else this.CallTKMInstall();
- }
- else if (ti.status == ti.UPDATE_REQ)
- {
- if(document.layers)
- {
- if (pc.IsWOTKInstallerRunning()) isInstallRunning = true;
- }
- if(document.all)
- {
- if(tu.IsTKMFileInUse('WOTKINSTALLUI2.exe') == 'YES') isInstallRunning = true;
- }
- //if (pc.IsWOTKInstallerRunning())
- if(isInstallRunning)
- {
- /* 74s_please_wait.gif */
- this.CreateChild(g_sTKMRoot + "html/please_wait.htm?geo=" + g_sGeo,"UserPrompt", ii.wait);
- }
- else
- {
- /* 72s_update_app.gif
- We have to call the CallTKMInstall before installing from the ti object or we will lose the scope of this page */
- //this.CreateChild(g_sTKMRoot + "scenarios/linkui/" + g_sGeo,"UserPrompt", ii.update);
- if(!GetCookie("skipTKMInstall")) this.CreateChild(g_sTKMRoot + "scenarios/linkui/user_prompt.htm?page=update&geo=" + g_sGeo,"UserPrompt", ii.update);
- else this.Exit();
- }
- }
- else if (ti.status == ti.NOT_INSTALLED)
- {
- /* 70s_install_tkm.gif
- We have to call the CallTKMInstall before installing from the ti object or we will lose the scope of this page */
- //this.CreateChild(g_sTKMRoot + "html/installTKM.htm?geo=" + g_sGeo,"UserPrompt", ii.install);
- if(!GetCookie("skipTKMInstall")) this.CreateChild(g_sTKMRoot + "scenarios/linkui/user_prompt.htm?page=install&geo=" + g_sGeo,"UserPrompt", ii.install);
- else this.Exit();
- }
- }
-
-
- function LUI_Poll()
- {
- var nRetVal = 0;
-
- nRetVal = wtui.GetStatus();
-
- if (nRetVal == 0) lui.Exit(); // If everything is done and the dialog is completed then return to the webpage
- else if (nRetVal == 4) setTimeout('lui.Poll()', 1000); // If the install is complete but the dialog has not been dismissed then check every one second
- else setTimeout('lui.Poll()', 3000); // If the download/install is still going check every three seconds
- }
-
-
- function LUI_Exit()
- {
- this.DestroyChild();
- setTimeout("eval(lui.exitfunc + '(' + lui.arglist + ');');", 1000);
- }
-
-
- function LUI_ExitInstall()
- {
- if (ti.installed)
- this.Run();
- }
-
-
- function LUI_TOOLSET_AddTool(key, ver0, ver1)
- {
- switch (LUI_TOOLSET_AddTool.arguments.length)
- {
- // If two arguments were passed in then this does not require separate installs for IE and NN
- case 2:
- this.tools[this.tools.length] = new this.TOOL(key, ver0);
- break;
-
- // If three argument were passed in then this requires separate versions for IE and NN
- case 3:
- if (document.all) this.tools[this.tools.length] = new this.TOOL(key + 'IE', ver0);
- else if (document.layers) this.tools[this.tools.length] = new this.TOOL(key + 'NS', ver1);
- break;
-
- // If any other number of params is passed in then fail
- default:
- break;
- }
- }
-
-
- function LUI_TOOLSET_Install(func)
- {
- var sToolList = '';
- var sArgList = '';
- var nRetVal = 0;
-
- /* Build toollist from the TOOLSET's tools collection so we know what to check for */
- for (i=0; i<this.tools.length; i++)
- {
- sToolList += this.tools[i].key + '#' + this.tools[i].version + ';';
-
- }
-
- /* Build the argument list for the function to call when the installation is complete */
- if (LUI_TOOLSET_Install.arguments.length > 1)
- {
- var arg = '';
- for (i=1; i<LUI_TOOLSET_Install.arguments.length; i++)
- {
- arg = LUI_TOOLSET_Install.arguments[i];
- // If the argument is a string preserve the data type by adding quotes around it
- if (typeof arg == 'string') arg = '"' + arg + '"';
-
- if (i > 1) sArgList += ', ' + arg + '';
- else sArgList += arg;
- }
- }
-
- /* Set the fields for the LUI object so we know what to do when we are finished */
- lui.exitfunc = func;
- lui.arglist = sArgList;
- lui.toollist = sToolList;
-
- /* Kick off the install */
- lui.Run();
- }
-
- function LUI_CreateChild(url, name, features)
- {
- this.childwindow = window.open(url,name,features);
- }
-
- function LUI_DestroyChild()
- {
- if (this.childwindow != null && !this.childwindow.closed)
- {
- if (document.layers)
- {
- this.childwindow.focus();
- this.childwindow.blur();
- window.focus();
-
- this.childwindow.close();
- this.childwindow = null;
- }
- else this.childwindow.close();
- }
- }
- /*
- function GetNewString(sString)
- {
- var sToolList = sString;
- var retVal = '';
- var toollist = '';
- var toolArr = new Array();
- var verArr = new Array();
-
- arr1 = sToolList.split(";");
- for(i=0; i<arr1.length-1; i++)
- {
- arr2 = arr1[i].split("#");
- toolArr[i] = arr2[0];
- verArr[i] = arr2[1];
- }
-
- xp.CreateXML(lui.MAINiXML);
-
- for (var x=0; x<toolArr.length; x++)
- {
- retVal = xp.CheckXML2(toolArr[x], g_sOS, "TOOL_MAP");
- if(retVal == 0 || retVal == 1) toollist += toolArr[x] + "#" + verArr[x] + ";";
- else if(retVal == 'NA') toollist = toollist;
- else toollist += retVal + "#" + verArr[x] + ";";
- }
- xp.UnloadXML(xp.xmlHandle);
-
- if(toollist == '') toollist = 'NA';
- return toollist;
- }
- */
- function LUI_Init()
- {
- /* Initialize any components that require it */
- ti.Init(this.scenario);
- tu.Init();
- if(document.layers) pc.Init();
- wtui.Init();
- //xp.Init();
-
- /* If we initializing after a TKM install that we initiated then immediately launch the tool install */
- if (top.LUI_launch && ti.status == ti.INSTALLED)
- {
- /* Reset the lui object fields with those we saved earlier */
- this.toollist = top.LUI_toollist;
- this.exitfunc = top.LUI_exitfunc;
- this.arglist = top.LUI_arglist;
-
- /* Clear the top variables that we set if the installation is finished */
- if (ti.status == ti.INSTALLED)
- {
- top.LUI_toollist = '';
- top.LUI_exitfunc = '';
- top.LUI_arglist = '';
- top.LUI_launch = false;
- }
-
- /* Run the install without any user action required */
- this.Run();
- }
- }
-
-
- var lui = new LUI(); // Create the Link UI Object if it exists
- //--></script>